gusucode.com > ASP+ACCESS在线手机销售系统(论文+源代码+答辩PPT) > ASP+ACCESS在线手机销售系统(论文+源代码+答辩PPT)\9)ASP 在线手机销售系统\HandsetPro\handset\admin\proAdd.asp
<!-- #include file = "include/sysbase.asp" --> <% function selectTreeList(i,deep) dim strSQL dim rsObj dim tempi dim nID, szName set rsObj = Server.CreateObject("ADODB.RecordSet") strSQL = "SELECT * FROM ProductType WHERE SuperID = "&i rsObj.Open strSQL, conn, adOpenKeyset, adLockReadOnly if rsObj.eof then exit function else do while not rsObj.eof nID = rsObj("id") szName = rsObj("name") if deep = -1 then Response.Write "<option value = '0'" else Response.Write "<option value = '"&nID&"'" end if if nID = ProductType then Response.Write " selected" Response.Write ">" for tempi = 1 to deep Response.Write " " next Response.Write szName&"</option>" call selectTreeList(nID,deep+1) rsObj.MoveNext loop end if end function dim ProductType if Request.QueryString("ProductType")<>"" then ProductType = cint(Request.QueryString("ProductType")) else ProductType = 0 end if %> <html> <head> <title>手机添加</title> <meta http-equiv = "Content-Type" content = "text/html; charset = gb2312"> <link rel = "stylesheet" href = "include/main.css" type = "text/css"> <script language = Javascript> <!-- function checkForm(){ if (form1.ProductType.value == '0'){ alert("请选择手机具体小类"); return false; } return true; } //--> </script> </head> <body text = "#000000"> <br> <form method = "post" action = "proAddSave.asp" name = "form1" onSubmit = "return checkForm()"> <table width = "70%" border = "1" bordercolordark = #9CC7EF bordercolorlight = #145AA0 cellspacing = "0" cellpadding = "4" align = "center"> <tr> <td colspan = "2" bgcolor = "#4296E7"> <div align = "center"><font color = "#FFFFFF">添加手机</font></div> </td> </tr> <tr> <td width = "20%" nowrap> <div align = "right">手机类别</div> </td> <td width = "80%"> <SELECT name = "ProductType"> <%call selectTreeList(0,0)%> </SELECT> </td> </tr> <tr> <td width = "20%" nowrap> <div align = "right">产品名称</div> </td> <td width = "80%"> <input type = "text" name = "name" size = "40"> </td> </tr> <tr> <td width = "20%" nowrap> <div align = "right">会 员 价</div> </td> <td width = "80%"> <input type = "text" name = "memberPrice" size = "12"> ¥</td> </tr> <tr> <td width = "20%" nowrap> <div align = "right">市 场 价</div> </td> <td width = "80%"> <input type = "text" name = "marketPrice" size = "12"> ¥</td> </tr> <tr> <td width = "20%" nowrap> <div align = "right">产品简介</div> </td> <td width = "80%"> <textarea name = "introduce" cols = "60" rows = "4"></textarea> </td> </tr> <tr> <td width = "20%" nowrap> <div align = "right">产品说明</div> </td> <td width = "80%"> <textarea name = "remark" cols = "60" rows = "4"></textarea> </td> </tr> <tr> <td colspan = "2" nowrap> <div align = "center"> <input type = "submit" name = "Submit" value = "添加"> <input type = "button" name = "Submit2" value = "清空"> </div> </td> </tr> </table> </form> </body> </html>